#include"Person.h"
#include"PersonImpl.h"

Person::Person(const std::string& name,const Date& birthday,const Address& addr):pImpl(new PersonImpl(name,birthday,addr)){}
std::string Person::name() const{
    return pImpl->name();
}

std::string Person::birthDate() const{
    return pImpl->birthDate();
}

std::string Person::address() const {
    return pImpl->address();
}

Person::PersonImpl::PersonImpl(const std::string& name,const Date& birthday,const Address& addr):theName(name),theBirthDate(birthday),theAddress(addr){
    
}

std::string Person::PersonImpl::name() const{
    return theName;
}

std::string Person::PersonImpl::birthDate() const{
    return theBirthDate.year + "/" + theBirthDate.month + "/" + theBirthDate.day;
}

std::string Person::PersonImpl::address() const{
    return theAddress.province_ + ", " + theAddress.city_ + ", " + theAddress.area_;
}